//
//  MXSlideShowView.h
//  MXSlideShow
//
//  Created by Bruce on 2019/10/9.
//  Copyright © 2019 陈学明. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MXPageControl.h"

@class MXSlideShowView;

@protocol MXSlideShowViewDelegate <NSObject>
@required
/// 轮播图总数量
- (NSInteger)numberPageSlideShowView:(MXSlideShowView *)slideShowView;
/// index 下对应的图片
- (UIImage *)slideShowView:(MXSlideShowView *)slideShowView imageAtIndex:(NSInteger)index;
@optional
/// index 下对应的图片地址,当代理对象实现这个方法后，slideShowView: imageAtIndex: 方法将无效
- (NSURL *)slideShowView:(MXSlideShowView *)slideShowView imageURLAtIndex:(NSInteger)index;

@optional
/// 点击事件
- (void)slideShowView:(MXSlideShowView *)slideShowView didSelectedAtIndex:(NSInteger)index;
/// 正在滚动
- (void)slideShowViewDidScroll:(MXSlideShowView *)slideShowView offsetX:(CGFloat)offsetX;

@end

/// 幻灯片
@interface MXSlideShowView : UIView <UIScrollViewDelegate>
/// 代理
@property (nonatomic, weak) id<MXSlideShowViewDelegate>delegate;
/// 占位图
@property (nonatomic, strong) UIImage *placeImage;
/// 当前滚动的标签
@property (nonatomic, assign) NSInteger currentIndex;
///  内部偏移量
@property (nonatomic, assign) UIEdgeInsets edgeInsets;
/// 圆角
@property (nonatomic, assign) CGFloat circularBead;
/// 自动循环滚动，默认为 YES
@property (nonatomic, assign) BOOL autoRollPool;
/// 运动时间间隔
@property (nonatomic, assign) NSTimeInterval duration;
/// 自动滑动的过渡动画时长
@property (nonatomic, assign) NSTimeInterval animationDuration;
/// 页码
@property (nonatomic, strong) MXPageControl *pageControl;

/** 刷新数据 */
- (void)reloadData;

/** 自动滚动进入挂起 */
- (void)suspend;

/** 自动滚动开始活动 */
- (void)activate;

- (void)destructionView;
@end

